<?php

class Comment_Modele extends Modele
{
	private $_id;
	private $_content;
	private $_creation_date;
	private $_validation_date;
	private $_articleId;
	private $_userId;
	
	
	static public function getRef($id, $content, $creation_date, $validation_date, $articleId, $userId)
	{
		return new Comment_Modele($id, $content, $creation_date, $validation_date, $articleId, $userId);
	}	
	
	public function Comment_Modele($id, $content, $creation_date, $validation_date, $articleId, $userId)
	{
		parent::Modele("comment","id");
		$this->_id = $id;
		$this->_content = $content;
		$this->_creation_date = $creation_date;
		$this->_validation_date = $validation_date;
		$this->_articleId = $articleId;
		$this->_userId = $userId;
	}
	
	public function get_id()
	{
		return $this->_id;
	}
	
	public function get_content()
	{
		return $this->_content;
	}
	
	public function get_creation_date()
	{
		return $this->_creation_date;
	}
	
	public function get_validation_date()
	{
		return $this->_validation_date;
	}
	
	public function get_articleId()
	{
		return $this->_articleId;
	}

	public function get_userId()
	{
		return $this->_userId;
	}
	
	public function get_owner_nickname()
	{
		$users = new User_Collection();
		$user = $users->getById($this->_userId);
		return $user->get_login();
	}

	public function set_validation_date($v)
	{
		$this->_validation_date = $v;
	}

}

?>